<?php
namespace thans\jwt\provider\storage;

use thans\jwt\contract\Storage;
use think\facade\Cache;
use think\facade\Config;

class Tp5 implements Storage
{
    public function delete($key)
    {
        return Cache::rm($key);
    }

    public function get($key)
    {
        return Cache::get($key);
    }

    public function set($key, $time = null)
    {
        return Cache::set($key, time(), $time === null ? Config::get('jwt.ttl') : $time);
    }
}